# -*- coding: utf-8 -*-
import scrapy
from ScrapyDev.items import ScrapydevItem

class WeisunSpider(scrapy.Spider):
    name = 'weisun'
    allowed_domains = ['baidu.com']
    start_urls = ['http://baidu.com/']
    # 通过xpath表达式提取（extract）内容
    def parse(self, response):
        item = ScrapydevItem()
        item["content"] = response.xpath("/html/head/title/text()").extract()
        yield  item #深层返回   return 浅层返回

